<admintpl file="header" />
</head>
<body>
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li><a href="{:U('Materials/index')}">物料管理</a></li>
            <li><a href="{:U('Materials/add')}" target="_self">添加物料</a></li>
            <li class="active"><a>卡券列表</a></li>
        </ul>
        <form class="well form-search" method="post" action="{:U('Materials/real')}">
            卡券状态：
            <select class="select_2" name="status">
                <option value='0'>全部</option>
                <foreach name="cardStatusList" item="vo">
                    <option <if condition="(I('param.status') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select> &nbsp;&nbsp;
           	创建时间：
            <input type="text" name="start_time" class="js-date" value="{:I('param.start_time')}" style="width: 80px;" autocomplete="off">-
            <input type="text" name="end_time" class="js-date"  value="{:I('param.end_time')}" style="width: 80px;" autocomplete="off"> &nbsp; &nbsp;
            卡券编码：
            <input type="text" name="keyword" style="width: 200px;" value="{:I('param.keyword')}" placeholder="请输入关键字...">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <if condition="$count" >共查询到 {$count} 条数据</if>
            <input type="hidden"  name="id" value="{:I('param.id')}"/>
        </form>
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                        <th>ID</th>
                        <!--<th>物料名称</th>-->
                        <th>卡券编码</th>
                        <th>创建时间</th>
                        <th width="110">卡劵状态</th>
                    </tr>
                </thead>
                <foreach name="cardslist" item="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <!--<td><foreach name="cards" item="card"><if condition="$vo['card_id'] eq $card['id']">{$card.card_name}</if></foreach></td>-->
                        <td>{$vo.card_number}</td>
                        <td>{$vo.created_at}</td>
                        <td>
							<if condition="$vo['card_status'] eq 0">
								未使用
							</if>
							<!--<if condition="$vo['card_status'] eq 1">
								<a href="{:U('Materials/cardsdown',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要暂停发放吗？"style="color: #FF0000;"><b>发放中</b></a> |
							</if>-->
                            <if condition="$vo['card_status'] eq 1 && $vo['order_status'] eq 0">
                                卡券已经中出
                            </if>
							<if condition="$vo['card_status'] eq 1 && $vo['order_status'] eq 1">
								<a href="{:U('Materials/verification',array('code'=>$vo['card_number'], 'card_id'=>$vo['card_id']) )}" class="js-ajax-dialog-btn" data-msg="您要核销此卡券吗？">核销</a>
							</if>
                            <if condition="$vo['card_status'] eq 1 && $vo['order_status'] eq 2">
                                卡券已经核销
                            </if>
							<!--<if condition="$vo['card_status'] eq 3">
								<a href="{:U('Materials/cardsup',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要开始发放吗？">已暂停 </a>
							</if>-->
							<if condition="$vo['card_status'] eq 2">
								已使用
							</if>
                        </td>
                    </tr>
                </foreach>
                <thead>
                    <tr>
                        <th>ID</th>
               <!--         <th>物料名称</th>-->
                        <th>卡券编码</th>
                        <th>创建时间</th>
                        <th width="110">卡劵状态</th>
                    </tr>
                </thead>
            </table>
            <div class="pagination">{$Page}</div>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
</body>
</html>